<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="icon" href="img/pumpkin.ico" type="image/x-icon"/>
    <title>订单管理系统</title>

    <!-- STYLES -->
    <link rel="stylesheet" href="lib/css/main.min.css"/>
    <link rel="stylesheet" href="lib/css/form-elements.css"/>
    <link rel="stylesheet" href="lib/css/style.css"/>
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">

    <!-- SCRIPTS -->
    <script src="lib/js/main.min.js"></script>
    <script src="lib/js/jquery.backstretch.min.js"></script>
    <script src="lib/js/scripts.js"></script>

    <!-- Favicon and touch icons -->
    <link rel="shortcut icon" href="img/favicon.png">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
</head>
<body>
<!-- Top content -->
<div class="top-content">
    <div class="inner-bg">
        <div class="container">
            <div class="row">
                <div class="col-sm-8 col-sm-offset-2 text">
                    <h1><strong>订单管理系统</strong></h1>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6 col-sm-offset-3 form-box">
                    <div class="form-top">
                        <div class="form-top-left">
                            <h3>登录管理平台</h3>
                        </div>
                        <div class="form-top-right">
                            <i class="fa fa-lock"></i>
                        </div>
                    </div>
                    <div class="form-bottom">
                        <form role="form" class="login-form">
                            <div class="form-group">
                                <input type="text" class="form-username form-control" id="form-username"
                                       placeholder="username">
                            </div>
                            <div class="form-group">
                                <input type="password" class="form-password form-control" id="form-password"
                                       placeholder="password">
                            </div>
                            <button type="button" class="btn" onclick="login()">登录</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function login() {
        var username = $('#form-username').val();
        var password = $('#form-password').val();
        $.post('/admin/index/login', {
            username: username,
            password: password,
            rememberMe: true
        }, function (result) {
            console.log(result);
            if (result['resultCode'] == 0) {
                window.location.href = '/index.html';
            }
        }, 'json');
    }
</script>
</body>
</html>